from selenium import webdriver
from webtestgit.verify import getverify
import time
class Web:

    def __init__(self):
        self.driver = None

    def openbrowser(self):
        self.driver = webdriver.Chrome()
        self.driver.implicitly_wait(10)

    def login(self):
        self.driver.get('http://www.testingedu.com.cn:8000/Home/user/login.html')
        self.driver.find_element_by_xpath('//*[@id="username"]').send_keys('13800138006')
        self.driver.find_element_by_xpath('//*[@id="password"]').send_keys('123456')
        #获取验证码截图
        self.driver.find_element_by_xpath('//*[@id="verify_code_img"]').screenshot('./verify.png')
        v = getverify()
        "2022-4-3"
        self.driver.find_element_by_xpath('//*[@id="verify_code"]').send_keys(v)
        time.sleep(10)
        self.driver.find_element_by_xpath('//*[@id="loginform"]/div/div[6]/a').click()
        print("登录成功")
        print("updtae one")
        print("update two''")
        "更新此文件但不合并"
        "update this file but not merge"
        "update this file but  nor merge 1"
        "sss"
        


